<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title> Accueil </title>
		<link rel="stylesheet" type="text/css"  media="screen" href="topic.css"/>
	</head>
 
	<body>

	<?php  
		if($_SESSION['log'] == 1){
			include_once("header_connecter.html");
		}else{
			include_once("header_deconnecter.html");
		} 
	?>
	<br/>
	<br/>
	<br/>
	<table name="table3" id="table3">
		<form action ="accueil.php" method="POST" >

				<tr>
				<td> Ville
				</td>
				<td>
				<select name="ville" id="ville">
						<?php while($val2=mysqli_fetch_array($Ville)){
							echo"<option value='".$val2['id']."'>".($val2['ville'])."</option>";}?>
				</select>
				</td>
				<td> Pays 
				</td>
				<td>
				<select name="pays" id="pays">
						<?php  while($val1=mysqli_fetch_array($Pays)){
				 			echo "<option value='".$val1['id']."'>".($val1['pays'])."</option>";} ?>
						</select>
				</td>
				<td> Type de bien
				</td>
				<td>
				<select name="type" id="type">
						<?php while($val3=mysqli_fetch_array($Type)){
							echo"<option value='".$val3['id']."'>".($val3['type'])."</option>";}?>
				</select>
				</td>
				<td> Tarif par jour
				</td>
				<td> <input type="text" name="tarifjour" id="tarifjour" />
				</td>
				<td> Tarif par semaine
				</td>
				<td> <input type="text" name="tarifsemaine" id="tarifsemaine" />
				</td>
				<td> Surface
				</td>
				<td> <input type="text" name="surface" id="surface" />
				</td>
				<td colspan="2" align="center"> <input type="submit" name="rechercher" value="Rechercher" id="rechercher" /> 
				</td>
				</tr>
				</table>

				<br/>
				<br/>

				
					
				<?php
				if(isset($_POST["rechercher"])){
		
					while ($data = mysqli_fetch_array($resultat))
					{
						echo"
						<table border ='1'>
							<tr>
								<td> </td>
								<td> Ville </td>
								<td> Pays </td>
								<td> Type de bien </td>
								<td> Tarif par jour </td>
								<td> Tarif par semaine </td>
								<td> Surface </td> 
								<td> Detail</td>	
							</tr>
							<tr>
								<td><img src=".$data['photo']."></td>
								<td>".$data['ville']."</td>
								<td>".$data['pays']."</td>
								<td>".$data['type']."</td>
								<td>".$data['tarif_jour']."</td>
								<td>".$data['tarif_semaine']."</td>
								<td>".$data['surface']."</td>
								<td><a href='info_bien.php?id=".$data['id_b']."'> Détails </a></td>
							</tr>
						</table>";
						
					}

					}

				?>
			</form>
		</table>
	</body>
</html>